from sklearn.neural_network import MLPClassifier
import numpy as np

from ENF_deepLearning.utils.parent.Base import Base


class NN_Classifier(Base):
    def nerual_network(self, x_train, x_test, y_train, y_test):
        mlp = MLPClassifier(hidden_layer_sizes=(64, 128), max_iter=5000, activation='relu')
        mlp.fit(x_train, y_train)
        res = mlp.predict(x_test)
        a = np.sum(res == y_test)
        print(res, y_test, a / y_test.shape[0])
        self.save_pred_true(res.tolist(), y_test.tolist())
